<%@ page language="java" contentType="text/html; charset=UTF-8" isErrorPage="true" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set var="pagePath" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${pagePath}/page/static/css/reset.css">
<link rel="stylesheet" type="text/css" href="${pagePath}/page/static/css/main.css">
<script type="text/javascript" src="${pagePath}/page/static/js/jquery-1.12.4.min.js"></script>
<title>校园二手交易网-商品详情</title>
</head>
<body>
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到 校园二手交易网！</div>
			<div class="fr">
				<div class="user_link fl">
					<c:if test="${!empty loguser}">
						欢迎您：<em style="color: red;">${loguser.username}</em>
						<span>|</span>
						<a href="${pagePath}/logout.do">退出</a>
					</c:if>
				</div>
				<div class="login_btn fl">
					<c:if test="${empty loguser}">
						<a href="${pagePath}/login.do">登录</a>
						<span>|</span>
						<a href="${pagePath}/register.do">注册</a>
					</c:if>
				</div>
			</div>
		</div>
	</div>
	<div class="search_bar clearfix">
		<a href="${pagePath}/index.do" class="logo fl"><img src="${pagePath}/page/static/images/logo.png"></a>
		<div class="search_con fl">
			<form action="${pagePath}/goods.do">
				<input type="text" class="input_text fl" id="key" name="key" placeholder="搜索商品" required="required"> <input type="submit" class="input_btn fr" value="搜索">
			</form>
		</div>
		<div class="guest_cart fr">
			<a href="${pagePath}/cart.do" class="cart_name fl">我的购物车</a>
		</div>
	</div>
	<div class="navbar_con">
		<div class="navbar">
			<div class="subnav_con fl">
				<h1 class="fl">商品区</h1>
				<span></span>
				<ul class="subnav">
					<c:forEach items="${types}" var="type">
						<li><a href="${pagePath}/goods.do?type_id=${type.id}">${type.name}</a></li>
					</c:forEach>
				</ul>
			</div>
			<ul class="navlist fl">
				<li><a href="${pagePath}/index.do" class="active">商品区</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/index_task.do">任务区</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/personal_info.do">个人中心</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/cart.do">购物车</a></li>
			</ul>
		</div>
	</div>
	<div class="breadcrumb">
		<a href="${pagePath}/goods.do">全部分类</a> <span>></span> <a href="${pagePath}/goods.do?type_id=${type.id}">${type.name}</a> <span>></span> <a href="javascript:;">商品详情</a>
	</div>
	<div class="goods_detail_con clearfix">
		<div class="goods_detail_pic fl">
			<img src="${pagePath}${goods.picture}" width="350" height="350">
		</div>
		<div class="goods_detail_list fr">
			<h3>${goods.name}</h3>
			<p>&nbsp;</p>
			<div class="prize_bar">
				<span class="show_pirze">¥<em>${goods.price}</em></span>
			</div>
			<div class="operate_btn">
				<a href="${pagePath}/cart_add.do?goods_id=${goods.id}" class="add_cart" id="add_cart">加入购物车</a>
			</div>
			<p>&nbsp;</p>
			<h3>卖家：${saleUser.name }&nbsp;&nbsp;综合评分：${saleUser.power}</h3>
		</div>
	</div>
	<div class="main_wrap clearfix">
		<div class="r_wrap clearfix">
			<ul class="detail_tab clearfix">
				<li class="active">商品介绍</li>
			</ul>
			<div class="tab_content">
				<dl>
					<dt>商品详情：</dt>
					<dd>${goods.description}</dd>
					<dd>=============</dd>
				</dl>
			</div>
			<ul class="detail_tab clearfix">
				<li class="active">商品评论</li>
			</ul>
			<div class="tab_content">
				<dl>
					<dt>商品评论：</dt>
					<c:forEach items="${comments}" var="commentItem">
						<dd>${commentItem.userId}:&nbsp;&nbsp;${commentItem.comment}</dd>
					</c:forEach>
					<form action="${pagePath}/goods_add_comment.do" method="post">
						<input type="text" name="goodIdIn" value="${goods.id}" style="visibility: hidden">
						<c:if test="${!empty loguser}">
							<input type="text" name="userIdIn" value="${loguser.username}" style="visibility: hidden">
						</c:if>
						<c:if test="${empty loguser}">
							<input type="text" name="userIdIn" value="匿名用户"w style="visibility: hidden">
						</c:if>
						<input type="text" name="commentIn" placeholder="输入你的评论..." >
						<input type="submit" value="发表评论" >
					</form>
				</dl>
			</div>
		</div>
	</div>
	<jsp:include page="footer.jsp"></jsp:include>
</body>
</html>